import request from '@/config/axios'

// 实时数据分发 VO
export interface RtDistributeVO {
  id: number // 主键
  ipAddress: string // EISC下IP地址
  port: string // EISC下端口号
  content: string // 内容
  remark: string // 备注
}

// 实时数据分发 API
export const RtDistributeApi = {
  // 查询实时数据分发分页
  getRtDistributePage: async (params: any) => {
    return await request.get({ url: `/base/rt-distribute/page`, params })
  },

  // 查询实时数据分发详情
  getRtDistribute: async (id: number) => {
    return await request.get({ url: `/base/rt-distribute/get?id=` + id })
  },

  // 新增实时数据分发
  createRtDistribute: async (data: RtDistributeVO) => {
    return await request.post({ url: `/base/rt-distribute/create`, data })
  },

  // 修改实时数据分发
  updateRtDistribute: async (data: RtDistributeVO) => {
    return await request.put({ url: `/base/rt-distribute/update`, data })
  },

  // 删除实时数据分发
  deleteRtDistribute: async (id: number) => {
    return await request.delete({ url: `/base/rt-distribute/delete?id=` + id })
  },

  // 导出实时数据分发 Excel
  exportRtDistribute: async (params) => {
    return await request.download({ url: `/base/rt-distribute/export-excel`, params })
  },
}